package org.dant.ant.extension.tasks;

import java.io.File;
import java.util.*;

import org.dant.ant.extension.types.Expect;
import org.apache.tools.ant.types.Environment;

public class RemoteExecutable extends RemoteTask {
  protected File dir;
  protected String dirstring = null;
  
  protected boolean blocking = false;
  protected boolean unique = false;
  protected int duplicate = 1;
  protected Environment env = new Environment();

  protected List expectlist = new LinkedList();

  protected boolean share = false;
  
  public void setShare(boolean share) {
    this.share = share;
  }
  
  public boolean getShare() {
    return this.share;
  }

  public File getDir() {
    return dir;
  }
  
  public void setDir(String d) {
    dirstring = d;
    this.dir = getProject().resolveFile(d, getProject().getBaseDir());
  }

  public Expect createExpect() {
    Expect expect = new Expect();
    
    expectlist.add(expect);
    return expect;
  }

  public List getExpectedList() {
    return expectlist;
  }

  public void setUnique(boolean unique) {
    this.unique = unique;
  }

  public boolean getUnique() {
    return this.unique;
  }

  public void setDuplicate(int duplicate) {
    this.duplicate = duplicate;
  }

  public int getDuplicate() {
    return this.duplicate;
  }

  public void setBlocking(boolean blocking) {
    this.blocking = blocking;
  }

  public boolean getBlocking() {
    return this.blocking;
  }
  public void addEnv(Environment.Variable var) {
    env.addVariable(var);
  }

  public String[]  getEnviroment() {
    return env.getVariables();
  }
  

}
